using System;
using Microsoft.Windows.UserControls.ViewModels;

namespace WizardSampleApp.ViewModels
{
    public class WizardPagePageOneViewModel : WizardPageViewModelBase
    {
        String dummyText;
       
        public WizardPagePageOneViewModel() : base("MY WIZARD", "Description of MY WIZARD (Page 01)", typeof(WizardPageIndexAllPagesViewModel))
        {
            Index.Title = "Index Title";
            PropertyChanged += OnPropertyChanged;
        }

        public String DummyText
        {
            get
            {
                return dummyText;
            }
            set
            {
                SetProperty(ref dummyText, value);
            }
        }

        void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "DummyText")
                Navigation.Next.IsEnabled = !String.IsNullOrEmpty(DummyText);
        }

        protected override void SetViewModelDefaultValues()
        {
            base.SetViewModelDefaultValues();
            Navigation.Next.IsEnabled = !String.IsNullOrEmpty(DummyText);
        }
    }
}